package com.jy.appmarket.statistics;

import java.io.Serializable;

import com.google.gson.Gson;

public class ApkSource implements Serializable {
	private static final long serialVersionUID = -3984236477590119149L;
	private static Gson gson = new Gson();
	private String path;
	private String packageName;
	private Integer index;
	private Long dataVersion;
	private String q;
	private String tagName;
	private String type;

	public String toSourceString() {
		return gson.toJson(this);
	}

	@Override
	public String toString() {
		return gson.toJson(this);
	}

	public static String toSourceString(ApkSource as) {
		if (as == null) {
			return null;
		}
		return gson.toJson(as);
	}

	ApkSource() {
	}

	/**
	 * for page
	 * 
	 * @param path
	 * @param index
	 * @param dataVersion
	 * @param type
	 */
	public ApkSource(String path, Integer index, Long dataVersion, String type) {
		this(path, null, index, dataVersion, null, null, type);
	}

	public ApkSource(String path, Integer index, Long dataVersion) {
		this(path, null, index, dataVersion, null, null, null);
	}

	public ApkSource(String path) {
		this(path, null, null, null, null, null, null);
	}

	public ApkSource(String path, String packageName, Integer index, Long dataVersion, String q, String tagName,
			String type) {
		this.path = path;
		this.packageName = packageName;
		this.index = index;
		this.dataVersion = dataVersion;
		this.q = q;
		this.tagName = tagName;
		this.type = type;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getPackageName() {
		return packageName;
	}

	public void setPackageName(String packageName) {
		this.packageName = packageName;
	}

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public Long getDataVersion() {
		return dataVersion;
	}

	public void setDataVersion(Long dataVersion) {
		this.dataVersion = dataVersion;
	}

	public String getQ() {
		return q;
	}

	public void setQ(String q) {
		this.q = q;
	}

	public String getTagName() {
		return tagName;
	}

	public void setTagName(String tagName) {
		this.tagName = tagName;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}